/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author chris
 */
import java.util.*;
import javax.swing.*;
public class Player extends People{
    private int hp;
    private int ac;
    private int str;
    private int sta;
    private int sp;
    private int acc;
    private ArrayList items;
    private ArrayList guns;
    public Player(ImageIcon myIcon, String name, int health, int armor, int strength, int stamina, int speed, int accuracy){
        super(myIcon, name);
        hp = health;
        ac = armor;
        str = strength;
        sta = stamina;
        sp = speed;
        acc = accuracy;
        setType("Player");
    }
    
    public void setHealth(int health){hp = health;}
    public int getHealth(){return hp;}
    
    public void setArmor(int armor){ac = armor;}
    public int getArmor(){return ac;}
    
    public void setStrength(int strength){str = strength;}
    public int getStrength(){return str;}
    
    public void setStamina(int stamina){sta = stamina;}
    public int getStamina(){return sta;}
    
    public void setSpeed(int speed){sp = speed;}
    public int getSpeed(){return sp;}
    
    public void setAccuracy(int accuracy){acc = accuracy;}
    public int getAccuracy(){return acc;}
    
    public void addToInventory(Item item){items.add(item);}
    public boolean removeFromInventory(Item item){return items.remove(item);}
    public ArrayList getInventory(){return items;}
    public Item getItem(int index){
        if(index < items.size()) return (Item)items.get(index); 
        else return null;
    }
    public Item getItem(Object item){
        for(int i = 0; i < items.size(); i++)
            if(items.get(i).equals(item))
                return (Item)items.get(i);
        return null;
    }
    
    public void addToGuns(Gun gun){guns.add(gun);}
    public boolean removeFromGuns(Gun gun){return guns.remove(gun);}
    public ArrayList getGuns(){return guns;}
    public Gun getGun(int index){
        if(index < guns.size()) return (Gun)guns.get(index);
        else return null;
    }
    public Object getGun(Object gun){
        for(int i = 0; i < guns.size(); i++)
            if(guns.get(i).equals(gun))
                return guns.get(i);
        return null;
    }

    }
